<div class="title">Báo cáo phân loại</div>
<div id="formBaocao">
	<div id="generalInfo" style="background: #eee;padding: 10px; margin-bottom: 2px;" >
		<?php echo $this->Form->create('Baocao', array('inputDefaults' => array('error' => false),'id'=>'XuLy')); ?>
		<p>
			<span style="display: inline-block; width: 80px;">Kỳ báo cáo</span>
			<span class="title3">Từ ngày</span>
			<span><?php echo $this->Form->input('from', array('div' => false, 'label' => false,"style" => "width: 80px;","class" => "datetime"));?></span>
			<span class="title3" style="width: 60px;">Tới ngày</span>
			<span><?php echo $this->Form->input('to', array('div' => false, 'label' => false,"style" => "width: 80px;","class" => "datetime"));?></span>
			<span class="title3">TTHC</span>
			<span><?php echo
				$this->Form->input('tthc_id',array(
                                      'type' => 'select',
                                      'options' => $tthcs,
                                      'selected' => 1,
                                      'div' => false,
                                      'label' => false
                                  ));
				?></span>
		</p>
		<div id="buttons" style="text-align: center;">
			<button class="button blue" id="xembaocao">Xem báo cáo</button>
			<button class="button blue" id="export">Xuất Excel</button>
			<div class="clear"></div>
		</div>
		<?php echo $this->Form->end();?>
	</div>
	
	<table width="100%" cellspacing="0">
		<tr>
			<td>STT</td>
			<td>Tên chỉ tiêu</td>
			<td>Mã quốc gia</td>
			<td>Đầu kỳ</td>
			<td>Trong kỳ</td>
			<td>Cuối kỳ</td>
		</tr>
		<?php if(isset($chiTieus))foreach ($chiTieus as $key => $chiTieu):?>
		<tr>
			<td align="center"><?php echo $key + 1;?></td>
			<td align="center"><?php echo $chiTieu['ct']['ten'];?></td>
			<td align="center"><?php echo $chiTieu['ct']['ma'];?></td>
			<td align="center"><?php echo $chiTieu['dauky']['dauky'];?></td>
			<td align="center"><?php echo $chiTieu['trongky']['trongky'];?></td>
			<td align="center"><?php echo $chiTieu['cuoiky']['cuoiky'];?></td>
		</tr>
		<?php endforeach; ?>
		<?php if (empty($chiTieus)):?>
		<tr>
			<td colspan="10" align="center">Hiện chưa có chỉ tiêu thống kê nào</td>
		</tr>
		<?php endif; ?>
</table>
</div>
<script type="text/javascript">
	$(document).ready(function (){
		$("input.datetime").datepicker({dateFormat:"dd/mm/yy",changeYear: true });
		$("input.datetime").attr("readonly","readonly");
		var form = $("#XuLy");
		
		$("#xembaocao").click(function () {
			submit('report/baocaoPl',form);
		});
		
		$("#export").click(function () {
			submit('report/export',form);
		});
	});
</script>